Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Introduce 'id' prop on <Tooltip> #2562

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ClayBenson94
Copy link

@ClayBenson94 ClayBenson94 commented Aug 16, 2023

Summary

This commit introduces a required 'id' property on the
component which replaces the random automatically generated one used previously.

Our application creates snapshot tests using jest-snapshot, and the randomly-generated IDs that come from this component make the snapshots no longer deterministic (and would fail on each run).

This PR is an attempt to address that. I can't say I'm in love with this solution as it does introduce a breaking change that would require IDs to be placed on <Tooltip> components across the board, so I am open to other solutions as well!

Related Issues or PRs

How To Test

Screenshots (optional)

BREAKING CHANGE: This commit introduces a required 'id' property on the <Tooltip>
component which replaces the random automatcially generated one used
previously.
@haworku
Copy link
Contributor

haworku commented Jan 4, 2024

@ClayBenson94 Hey - that use case makes a lot sense to me!

In terms of implementation - can we surface the id?: string as an optional prop that falls back to the randomly generated id. That way we avoid the breaking change but still have always have an id that can be accessed internally for tooltip

@werdnanoslen
Copy link
Contributor

@ClayBenson94 do you have some time to make the change Hana suggested? ☝️

@ClayBenson94 ClayBenson94 requested review from a team as code owners February 13, 2024 06:37
Copy link
Contributor

@shkeating shkeating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lookin good from design standpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants